package com.yootk.listener;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;

@Component
public class NewsListener implements SmartLifecycle {
    private static final Logger LOGGER = LoggerFactory.getLogger(NewsListener.class) ;
    private boolean running = false ;
    public void onListener(String msg){
        LOGGER.info("【2】接收新闻：{}",msg);
    }

    @Override
    public void start() {
        LOGGER.info("【2】打开新闻");
        this.running = true ;
    }

    @Override
    public void stop() {
        this.running = false ;
        LOGGER.info("【2】关闭新闻");
    }

    @Override
    public boolean isRunning() {
        return this.running;
    }

    @Override
    public boolean isAutoStartup() {
        return true;
    }

    @Override
    public int getPhase() {
        return Integer.MIN_VALUE;
    }
}
